-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[processor/resourcedetection] Add feature gate to change stepping to string #31165
Conversation
06119b3
to
af60489
Compare
457f75a
to
4ddf9e1
Compare
// https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/31136 | ||
d.logger.Info("This attribute will change from int to string. Switch now using the feature gate.", | ||
zap.String("attribute", "host.cpu.stepping"), | ||
zap.String("feature gate", hostCPUSteppingAsStringID), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should go on the other if branch, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, after the change to address #31165 (comment) that one needs to be switched as well. Thank's for spotting this.
…string Signed-off-by: ChrsMark <[email protected]>
4ddf9e1
to
bc37ccc
Compare
cc: @open-telemetry/semconv-system-approvers |
…string (open-telemetry#31165) open-telemetry#31136 Description: Add feature gate to change CPU stepping to string, to adapt to open-telemetry/semantic-conventions#664. Link to tracking Issue: Fixes open-telemetry#31136 Testing: Tested with the sample configuration on open-telemetry#26533. ### Logs ```console 2024-02-09T15:18:02.014+0200 info [email protected]/telemetry.go:59 Setting up own telemetry... 2024-02-09T15:18:02.014+0200 info [email protected]/telemetry.go:104 Serving metrics {"address": ":8888", "level": "Basic"} 2024-02-09T15:18:02.015+0200 info [email protected]/service.go:140 Starting otelcontribcol... {"Version": "0.94.0-dev", "NumCPU": 8} 2024-02-09T15:18:02.015+0200 info extensions/extensions.go:34 Starting extensions... 2024-02-09T15:18:02.015+0200 info internal/resourcedetection.go:125 began detecting resource information {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics"} 2024-02-09T15:18:02.015+0200 info system/system.go:209 This attribute changed from int to string. Temporarily switch back to int using the feature gate. {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "attribute": "host.cpu.family", "feature gate": "processor.resourcedetection.hostCPUModelAndFamilyAsString"} 2024-02-09T15:18:02.015+0200 info system/system.go:228 This attribute changed from int to string. Temporarily switch back to int using the feature gate. {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "attribute": "host.cpu.model.id", "feature gate": "processor.resourcedetection.hostCPUModelAndFamilyAsString"} 2024-02-09T15:18:02.015+0200 info system/system.go:245 This attribute changed from int to string. Temporarily switch back to int using the feature gate. {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "attribute": "host.cpu.stepping", "feature gate": "processor.resourcedetection.hostCPUSteppingAsString"} 2024-02-09T15:18:02.015+0200 info internal/resourcedetection.go:139 detected resource information {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "resource": {"host.cpu.cache.l2.size":12288,"host.cpu.family":"6","host.cpu.model.id":"140","host.cpu.model.name":"11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz","host.cpu.stepping":"%!f(int32=1)","host.cpu.vendor.id":"GenuineIntel","host.id":"d6488716404e4ce4854ff0e230944c6d","host.name":"chrismark-ThinkPad-X1-Carbon-Gen-9","os.type":"linux"}} 2024-02-09T15:18:02.016+0200 info [email protected]/service.go:166 Everything is ready. Begin running and processing data. 2024-02-09T15:18:02.016+0200 warn localhostgate/featuregate.go:63 The default endpoints for all servers in components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default. {"feature gate ID": "component.UseLocalHostAsDefaultHost"} ``` ### Sample output ```json {"resourceMetrics":[{"resource":{"attributes":[{"key":"host.name","value":{"stringValue":"chrismark-ThinkPad-X1-Carbon-Gen-9"}},{"key":"os.type","value":{"stringValue":"linux"}},{"key":"host.id","value":{"stringValue":"d6488716404e4ce4854ff0e230944c6d"}},{"key":"host.cpu.vendor.id","value":{"stringValue":"GenuineIntel"}},{"key":"host.cpu.family","value":{"stringValue":"6"}},{"key":"host.cpu.model.id","value":{"stringValue":"140"}},{"key":"host.cpu.model.name","value":{"stringValue":"11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz"}},{"key":"host.cpu.stepping","value":{"stringValue":"%!f(int32=1)"}},{"key":"host.cpu.cache.l2.size","value":{"intValue":"12288"}}]},"scopeMetrics":[{"scope":{"name":"otelcol/hostmetricsreceiver/cpu","version":"0.94.0-dev"},"metrics":[{"name":"system.cpu.time","description":"Total seconds each logical CPU spent on each mode.","unit":"s","sum":{"dataPoints":[{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1273.45},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":174.29},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19845.95},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.95},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":18.22},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":29.94},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1327.97},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":175.68},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19804.5},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.06},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":9.11},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":28.7},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1249.04},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":178.22},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19846.01},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":2.48},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":10.42},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":26.88},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1211.17},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":176.69},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19912.68},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.45},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":4.92},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":28.48},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1254.73},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":179.59},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19869.65},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.11},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":2.92},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":25.91},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1272.94},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":176.64},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19825.63},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.01},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":3.33},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":24.5},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1317.85},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":176.44},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19803.92},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.7},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":3.87},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":32.35},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1238.01},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":198.62},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19849},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.84},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":2.49},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":27.29}],"aggregationTemporality":2,"isMonotonic":true}}]}],"schemaUrl":"https://opentelemetry.io/schemas/1.9.0"}]} ``` cc: @mx-psi Signed-off-by: ChrsMark <[email protected]>
…PUSteppingAsString` to beta (#33076) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Follow up to #31165. The feature gate has been in alpha since v0.95.0. **Link to tracking Issue:** Relates to #31136 and open-telemetry/semantic-conventions#664 cc @ChrsMark
…USteppingAsString feature gate to stable (#35202) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Follows #33076 and #31165. **Link to tracking Issue:** <Issue number if applicable> #31136 **Testing:** <Describe what testing was performed and which tests were added.> **Documentation:** <Describe the documentation added.> /cc @mx-psi Signed-off-by: ChrsMark <[email protected]>
…USteppingAsString feature gate to stable (open-telemetry#35202) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Follows open-telemetry#33076 and open-telemetry#31165. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#31136 **Testing:** <Describe what testing was performed and which tests were added.> **Documentation:** <Describe the documentation added.> /cc @mx-psi Signed-off-by: ChrsMark <[email protected]>
#31136
Description:
Add feature gate to change CPU stepping to string, to adapt to open-telemetry/semantic-conventions#664.
Link to tracking Issue: Fixes #31136
Testing: Tested with the sample configuration on #26533.
Logs
Sample output
cc: @mx-psi